package com.lingchen.response;


import com.lingchen.enums.ResultEnum;

/**
 * Author    lingchen
 * Email     838878458@qq.com
 * Time      2017/11/29
 * Function  结果
 */
public class Result<T> {
    private int code = ResultEnum.SUCCESS.getCode();
    private String message = ResultEnum.SUCCESS.getMessage();
    private T data;

    Result(T data) {
        this.data = data;
    }

    Result(int code, String message) {
        this.code = code;
        this.message = message;
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public T getData() {
        return data;
    }

    public void setData(T data) {
        this.data = data;
    }

    @Override
    public String toString() {
        return "Result{" +
                "code=" + code +
                ", message='" + message + '\'' +
                ", data=" + data +
                '}';
    }


}
